package IProvider;

sub new {
	# types are: 's' - means singleton, 'd' - direct, 'c' - client/custom
	
	my ($iprovider, $class_sig, $impl_sig, $method, $type) = (shift, shift, shift, shift, shift);
	return bless {class_sig => $class_sig, impl_sig=> $impl_sig, method => $method, type => $type, sig=>shift}, $iprovider;
}

sub to_str {
	my %this = %{(shift)};
	return "class: $this{class_sig}, impl: $this{impl_sig}, method: $this{method}";
}

sub method {
	return (shift)->{method};
}

sub class_sig {
	return (shift)->{class_sig};
}

sub impl_sig {
	return (shift)->{impl_sig};
}

sub type {
	return (shift)->{type};
}

sub isSingleton {
	return (shift)->{type} eq 's';
}

sub isDirect {
	return (shift)->{type} eq 'd';
}

sub isCustom {
	return (shift)->{type} eq 'c';
}

sub setSignature {
	my ($this, $cclass) = @_;
	$this->{sig} = $cclass;
}

sub sig {
	return (shift)->{sig};
}

1;